package com.mxpio.erp.common.plan.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;

import com.mxpio.erp.common.jpa.model.BizPlan;

import com.mxpio.erp.common.technology.entity.Item;
import com.mxpio.erp.common.technology.entity.WorkCenter;
import com.mxpio.erp.common.technology.entity.WorkShop;
import com.mxpioframework.security.annotation.Dict;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

@Data
@EqualsAndHashCode(callSuper=false)
@Entity
@Table(name = "MB_ERP_PLAN_MANUFACTURING")
@Schema(description="制造计划")
public class ManufacturePlan extends BizPlan {

	private static final long serialVersionUID = 1L;

	@Column(name = "MAIN_WORKSHOP_")
	@Schema(description = "主制车间")
	@Dict(dicCode = "workShopCode",dicEntity = WorkShop.class,dicText = "workShopName")
	private String mainWorkshop;

	@Column(name = "WORK_CENTER_CODE_")
	@Schema(description = "工作中心")
	@Dict(dicCode = "workCenterCode",dicEntity = WorkCenter.class,dicText = "workCenterName")
	private String workCenterCode;


	@Column(name = "OUTSOURCE_FLAG_")
	@Schema(description = "委外标识")
	@Dict(dicCode = "ERP_COMMON_YESNO")
	private String outsourceFlag;

	@Column(name = "ITEM_NAME_")
	@Schema(description = "物料名称")
	private String itemName ;

	@Column(name = "ITEM_SPEC_")
	@Schema(description = "规格型号")
	private String itemSpec;

	@Column(name = "UNIT_CODE_")
	@Schema(description = "单位编号")
	@Dict(dicCode="ERP_TECH_UNIT_CODE")
	private String unitCode;

	@Column(name = "DRAWING_NO_")
	@Schema(description = "图号")
	private String drawingNo;

	@Transient
	@Schema(description = "可自制")
	@Dict(dicCode = "ERP_COMMON_YESNO")
	private String manufactureAble;

	@Transient
	@Schema(description = "可委外")
	@Dict(dicCode = "ERP_COMMON_YESNO")
	private String outsourceAble;

	@Schema(description = "加工商编号")
	//@Column(name = "PN_CODE_")
	@Transient
	private String pnCode;

	@Schema(description = "加工商名称")
	//@Column(name = "PN_NAME_")
	@Transient
	private String pnName;

	@Schema(description = "业务员")
	//@Dict(dicCode = "username",dicEntity = User.class,dicText = "nickname")
	private String bizMan ;


	@Transient
	private Item item;
}
